<template>
  <div>
    <FormTable :formData="formData"
               :columnData="columnData"
               :editData="editData"
               :is_show_new="false"
               :url="$api.lottery_record_getlist"
               :pageConfig="pageConfig"></FormTable>
  </div>
</template>

<script>
export default {
  data () {
    return {
      formData: [
        {
          name: 'lottery_title',
          label: '抽奖活动标题',
          value: '',
          type: 'input'
        },
        {
          name: "source",
          label: "抽奖来源",
          value: '',
          type: 'select',
          groups: [
            {
              label: '所有',
              value: ''
            },
            {
              label: '会员免费抽奖',
              value: '0'
            },
            {
              label: '消耗积分抽奖',
              value: '1'
            },
          ]
        },
        {
          name: "start_time",
          label: "开始时间",
          value: '',
          type: "date_time_picker",
          config: {
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            'value-format': 'yyyy-MM-dd HH:mm:ss',
          }
        },
        {
          name: "end_time",
          label: "结束时间",
          value: '',
          type: "date_time_picker",
          config: {
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            'value-format': 'yyyy-MM-dd HH:mm:ss',
          }
        },
      ],
      columnData: [
        {
          prop: "lottery_record_id",
          label: "id"
        },
        {
          prop: "explain",
          label: "抽奖来源说明"
        },
        {
          prop: "lottery_title",
          label: "抽奖活动标题"
        },
        {
          prop: "nickName",
          label: "抽奖者昵称"
        },
        {
          prop: "prize_title",
          label: "中奖标题"
        },
        {
          prop: "create_time",
          label: "抽奖时间"
        },
      ],
      editData: [
        {
          name: 'prize_id',
          label: '奖品id',
          value: '',
          type: 'input',
          display: 'none'
        },
        {
          name: 'lottery_id',
          label: '抽奖活动',
          value: '',
          type: 'select',
          groups: []
        },
        {
          name: 'lottery_id',
          label: '抽奖活动',
          value: '',
          type: 'select',
          groups: [
            {
              label: '谢谢参与',
              value: '0'
            },
            {
              label: '权益产品',
              value: '1'
            },
            {
              label: '自有会员卡',
              value: '2'
            },
            {
              label: '满减券折扣券',
              value: '3'
            },
            {
              label: '实物',
              value: '4'
            },
            {
              label: '积分',
              value: '5'
            },
          ]
        },
        {
          name: 'probability',
          label: '中奖概率（0-100）',
          value: '',
          type: 'input',
        },
        {
          name: 'limit_num',
          label: '奖品数量',
          value: '',
          type: 'input',
        },
        {
          name: 'limit_num',
          label: '奖品数量',
          value: '',
          type: 'input',
        },
        {
          name: 'connect_id',
          label: '奖品',
          value: '',
          type: 'select',
          groups: []
        },
        {
          name: 'rule',
          label: '奖品规则',
          value: '',
          type: 'input',
        },
        {
          name: 'sort',
          label: '排序',
          value: '',
          type: 'input',
        },
        {
          name: "display",
          label: "是否显示",
          value: '',
          type: 'switch',
          config: {
            'active_value': '1',
            'inactive-value': '0'
          }
        },
      ],
      pageConfig: {
        page: 1,
        pagesize: 10,
      }
    };
  },
  created () {
  },
  methods: {
    handleSizeChange (e) {
      console.log(e);
    },
    handleCurrentChange (e) {
      console.log(e);
    },
    submit (e) {
      console.log(e);
    },
    reset (e) {
      console.log(e);
    }
  }
}
</script>

<style lang="scss" scoped>
</style>